package com.cykj.controller;

import com.cykj.annoation.Log;
import com.cykj.dto.ResponseDTO;
import com.cykj.service.IUserService;
import com.cykj.vo.UserVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Program: Mooc-Admin
 * @Package: com.cykj.controller
 * @Author: 张俊杰
 * @Create: 2025-07-09 21:21
 * @Description: TODO
 * @Vision: 1.0
 **/
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * @Description:查询用户信息
     * @Param:[userVO]
     * @Return:com.cykj.dto.ResponseDTO
     */
    @Operation(summary = "查询用户信息")
    @Log(model = "用户模块", value = "查询用户信息")
    @GetMapping("list")
    public ResponseDTO getListUser(UserVO userVO) {

        return userService.getListUser(userVO);
    }

    /**
     * @Description:重置密码
     * @Param:[userVO]
     * @Return:com.cykj.dto.ResponseDTO
     */
    @Operation(summary = "重置密码")
    @Log(model = "用户模块", value = "重置密码")
    @PostMapping("reset")
    public ResponseDTO resetUserPassword(@RequestBody UserVO userVO) {
        System.out.println(userVO);
        return userService.resetUserPassword(userVO);
    }

}
